#!/bin/sh -e

# Remove highscores file if purging
if [ "$1" = "purge" ] ; then
UHOME="/home"
	_APPDIR=".MyGarden"
	_USERS="$(awk -F':' '{ if ( $3 >= 500 ) print $1 }' /etc/passwd)" # get list of all users
	for u in $_USERS
	do
		_dir="${UHOME}/${u}/${_APPDIR}"
		if [ -d "$_dir" ]
		then
			rm -r "${_dir}"
		fi
	done
fi

exit 0